package d02_enum;

public class Test03 {
     public static void main(String[] args) {
        //枚举的应用场景:通常用来表示一组信息，让后作为参数进行传输。
        System.out.println(HandleData(45.23,Enum02.HALF_UP));

    }
    public static double HandleData(double number,Enum02 flag){
        switch (flag){
            case DOWN:
                number=Math.floor(number);//向下取整
                break;
            case UP:
                number=Math.ceil(number);//向上取整
            case HALF_UP:
                number=Math.round(number);//四舍五入
            case DELETE_LEFT:
                number=(int)number;
        }

        return number;
    }
}
